//定义一个数据
import Vue from 'vue'

let index = {
    state:  {   //  全局性的变量
       title:'查看学校',
        school: [],
        mescroll: null,
        page:{num:0, size:10}
    },
    mutations: {
        addSchoolList (state, school) { // 自定义方法
            state.school = school
        }
    },
    actions: {
    	getSchool (store) {
            Vue.axios.get('https://oa.fc62.com/api/school/getSchoolList/page/1',{},{
                headers: {
                    "Content-Type": "application/json;charset=utf-8"
                }
            }).then(response => {
                store.commit('addSchoolList', response.data.data)
            })
       }
    }
}
export default index //导出数据